#!/bin/bash

CWD=`cd $(dirname $0); pwd`
DSTDIR=$HOME

echo 'backup old emacs.d configuration'
[ -f $DSTDIR/.emacs ] && mv $DSTDIR/.emacs  $DSTDIR/.emacs.orig
[ -d $DSTDIR/.emacs.d ] && mv $DSTDIR/.emacs.d $DSTDIR/.emacs.d.orig

echo 'copy new configuration'
cp -rf $CWD/emacs $DSTDIR/.emacs
cp -rr $CWD/emacs.d $DSTDIR/.emacs.d

echo 'DONE'


